package com.chenxiao.responsibilityChain.design;

/**
 * @Author: CX
 * @Date: Created in  2023/05/28 16:32
 * @version: v1.0
 * @Description: TODO
 **/
public class Staff extends DesignModel {
    Staff(String name) {
        super(name);
    }

    @Override
    public void approve(int amount) {
        if(amount > 1000){
            // 审批自动升级
            //this.setNextApprove(new Manager("经理名称"));
            System.out.println("无权限审批，【"+name+"】");
            this.NextApprover.approve(amount);
        }else{
            System.out.println("审批成功，【"+name+"】");
        }
    }
}
